#pragma once

///////////////////////////////////////////////////////////////////////////
//																		 //
//	Author:		Michael Mozdzierz										 //
//	Date:		12/13/2014												 //
//	Purpose:	Create a class that manages which sampler(s) are		 //
//				currently bound											 //
//																		 //
///////////////////////////////////////////////////////////////////////////

#include <D3D11.h>
#include "GraphicsManager.h"
typedef ID3D11SamplerState SamplerState;

#define ALL_TEXTURE_SLOTS 0xffffffff

// Class that manages all sampler states in the game
class SamplerStateManager
{
	friend class GraphicsManager;
	static ID3D11Device* device;
	static ID3D11DeviceContext* context;

	SamplerStateManager(void);
	~SamplerStateManager(void);
public:
	struct
	{
		SamplerState* linearClamp;
		SamplerState* linearWrap;
	} samplers;

	// get the sampler bound on slot 'index'
	SamplerState* getCurrentSamplerState(unsigned int slotIndex) const;

	// sets the provided state to the texture on 'slotIndex'
	void setCurrentSamplerState(SamplerState* state, PiplineIndex slotIndex);

	static SamplerStateManager* GetInstance(void)
	{
		static SamplerStateManager instance;

		return &instance;
	}
};